#pragma once

namespace DeForm
{
	public enum struct ColorMatrixAlphaMode { Premultiplied = 1, Straight = 2};

	public ref class ColorMatrixEffectDescription sealed : IEffectDescription
	{
	public:		
		ColorMatrixEffectDescription(const Array<float>^ colorMatrix, ColorMatrixAlphaMode alphaMode, bool clampOutput);
		ColorMatrixEffectDescription();

		virtual EffectType GetEffectType()
		{
			return EffectType::ColorMatrix;
		}

		virtual int GetParametersCount()
		{
			return 3;
		}

		virtual EffectParameterValue^ GetParameter(int index)
		{
			switch (index)
			{
			case 0:
				return ref new EffectParameterValue(D2D1_COLORMATRIX_PROP_COLOR_MATRIX, ColorMatrix);
			case 1:
				return ref new EffectParameterValue(D2D1_COLORMATRIX_PROP_ALPHA_MODE, (int)AlphaMode);
			case 2:
				return ref new EffectParameterValue(D2D1_COLORMATRIX_PROP_CLAMP_OUTPUT, ClampOutput);
			}

			return nullptr;
		}

		property Array<float>^ ColorMatrix;
		property ColorMatrixAlphaMode AlphaMode;
		property bool ClampOutput;
	};
}

